package reflect;

import java.util.Scanner;

public class ReflectDemo2 {
    public static void main(String[] args) throws Exception {
        Person p1=new Person();
        System.out.println(p1);

        System.out.println("input:");
        Scanner scanner = new Scanner(System.in);
        String className=scanner.nextLine();
        Class c=Class.forName(className);
        Object object = c.newInstance();
        System.out.println(object);
    }
}
